package com.huizluo.module4.student;

public class Test {
    public static void main(String[] args) {
        System.out.println("Welcome Student Manager System！！！");
        Store database = new ListStore();
        database.Load();
        BaseCommand root = new BaseCommand("root","查看帮助请输入help然后按回车键,退出请输入exit然后按回车键");

        Command add = new AddCommand("add","输入add按回车进入创建模式,然后输入学生信息,输入格式：id=1 name=xxx age=20",database);
        Command find = new FindCommand("find","输入find按回车进入查找模式,然后输入学生id信息进行查找",database);
        Command remove = new RemoveCommand("remove","输入remove按回车进入删除模式，然后输入学生id进行删除",database);
        Command update = new UpdateCommand("update","输入update按回车进入更新模式，然后输入学生信息进行更新，输入格式：id=1 name=xxx age=20",database);
        Command list = new ListCommand("list","输入list按回车进入遍历模式",database);

        root.register(add);
        root.register(find);
        root.register(remove);
        root.register(update);
        root.register(list);

        root.run(null);
        database.Save();
        System.out.println("系统退出");
    }
}
